<{include file="Public/top.html" }>
</head>
<div id="warpper">
    <div class="content">
        <div class="location">卡券管理</div>
        <{include file="Card/nav.html"}>
        <div class="filedSet" style="padding-bottom: 0;">
            <div class="search">
                <form action="" class="ui-form reportForm" id="searchForm" method="get">
                    <input name="m" type="hidden" value="<{$module}>">
                    <input name="c" type="hidden" value="<{$controller}>">
                    <input name="a" type="hidden" value="<{$action}>">

                    <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                    <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">
                    <input name="ofield" id="ofield" type="hidden" value="<{$ofield}>">
                    <input name="otype"  id="otype"  type="hidden" value="<{$otype}>">

                    <div class="ui-form-item inline-block">
                        <label class="ui-label">时间段</label>
                        <input type="text" name="startDate" value="<{$startDate}>" id="startDate" class="ui-text startDate" readonly/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">—&nbsp;&nbsp;&nbsp;</label>
                        <input type="text" name="endDate" value="<{$endDate}>"  id="endDate" class="ui-text endDate" readonly/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">卡券号</label>
                        <input type="text" name="code" class="ui-text bg-text keyword" value="<{$code}>"/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">状态</label>
                        <select name="status" class="ui-select">
                            <option value="-1">全部</option>
                            <{html_options options=$statusType selected=$status}>
                        </select>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">所属卡券</label>
                        <select name="cardId" class="ui-select">
                            <option value="0">全部</option>
                            <{html_options options=$cardList selected=$cardId}>
                        </select>
                    </div>
                    <div class="ui-form-item inline-block">
                        <button type="submit" class="ui-button" onclick="LayerShow();">查询</button>
                        <button type="button" class="ui-button" onclick="exportData()">导出</button>
                    </div>
                </form>
            </div>
        </div>

        <!--表格内容-->
        <div class="mainGrid">
            <table class="ui-table ui-body">
                <thead>
                <tr>
                    <th class="pct10">卡券号码</th>
                    <th class="pct10">昵称</th>
                    <th class="pct10">客户姓名</th>
                    <th class="pct10">手机号码</th>
                    <th class="pct10">状态</th>
                    <th class="pct10 last-col">核销时间</th>
                </tr>
                </thead>
                <tbody>
                <{foreach from=$list item=item}>
                <tr>
                    <td><{$item.code}></td>
                    <td><{$item.nickname}></td>
                    <td><{$item.realName}></td>
                    <td><{$item.bindPhone}></td>
                    <td><{$statusType[$item.status]}></td>
                    <td><{if $item.consumeTime gt 0 }><{'Y-m-d H:i'|date:$item.consumeTime}><{/if}></td>
                </tr>
                <{/foreach}>

                </tbody>
            </table>
        </div>
        <!--描述：分页-->
        <div class="pagination">
            <{include file="Public/page.html"}>
        </div>
    </div>
</div>
<body>
<{include file="Public/foot.html" }>
<script>

    datePickter('startDate','endDate',true);
    function exportData(){
        var exportUrl = "<{U('Card/record')}>";
        $data=$('#searchForm').serialize();
        window.location.href = exportUrl+$data+'&export=1';

    }
</script>